﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="lp_Report_list.aspx.cs"
    Inherits="ZLDC.Estate.Quantify.Report.lp_Report_list" %>

<%@ Register Src="~/UserControl/Dept_Tree.ascx" TagName="Dept_Tree" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../css/main.css" rel="stylesheet" type="text/css" />

    <script src="../charts/FusionCharts.js" type="text/javascript"></script>

    <script src="../popup/popup2/popup.js" type="text/javascript"></script>

    <link href="../css/page.css" rel="stylesheet" type="text/css" />

  <script src="../../js/jquery/jquery-1.3.2.js" type="text/javascript"></script>

    <script src="../charts/highcharts1.js" type="text/javascript"></script>

    <script src="../js/GetUrl.js" type="text/javascript"></script>

    <script type="text/javascript">
        function FKalert(deptid, userid, statrday, endday, name, number) {

            ShowIframe("lp_Report_Userlist.aspx?deptid=" + deptid + "&userid=" + userid + "&statrday=" + statrday + "&endday=" + endday + "&number=" + number + "", 550, 400, name + "工作项详细");
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="divdatalist">
        <img src="../../images/loading.gif" /></div>
   <%-- <%=sb.ToString() %>--%>

   

    <asp:Literal ID="myNext" runat="server"></asp:Literal>
    <asp:HiddenField ID="hidchart" runat="server" />
    <div id="diccharttoday">
    </div>

    <script type="text/javascript">
        if (document.getElementById('hidchart').value != "") {
            var station = '<%=station %>';

            var todaychart = "[";
            todaychart += document.getElementById('hidchart').value;
            todaychart = todaychart.substring(0, todaychart.length - 1);
            todaychart += "]";

            todaychart = eval('' + todaychart + '');
            chartxs1(todaychart, '工作', 'diccharttoday', station);
        }
    </script>
 <script type="text/javascript">

        var deptid = '<%=deptid %>';
        var statrday ="'"+ <%=statrday %>+"'";
        var endday ="'"+<%=endday %>+"'";
        var depttype = '<%=depttype %>'; //获取部门类型
        window.onload=function loadDatalist() {
       
            $.ajax({
                type: "POST",
                url: "../AjaxServer.aspx",
                dataType: 'json',
                data: "alt=divdatalist&deptid=" + deptid + "&statrday=" + statrday + "&endday=" + endday + "&depttype=" + escape(depttype) + "",
                processData: false,
                timeout: '10000',
                success: function(msg) {
                    datalist(msg);
                    
                },
                error: function() {
               
                    document.getElementById('divdatalist').innerHTML = "系统繁忙";

                }

            });

        }

        function datalist(msg) {
             var arr = [];
             
            arr.push("<table id=\"tb1\" width=\"70%\" cellpadding=\"0\" cellspacing=\"1\" border=\"0\">");
            arr.push("<caption></caption>");
            arr.push("<thead>");
            arr.push("<tr>");
            arr.push("<th align=\"center\" width=\"50\"  class=\"th\">");
             if (depttype == "营业大部")
            {
                arr.push("营业部");
            }
            else if (depttype == "营业部")
            {
                arr.push("区域");
            }
            else if (depttype == "区域")
            {
                arr.push("分行");
            }
            else if (depttype == "分行")
            { 
                    arr.push("姓名");
            }
                arr.push("</th>");
                arr.push("<th align=\"center\" width=\"50\"  class=\"th\">");
                arr.push("总分");
                arr.push("</th>");
                arr.push("</tr>");
             for (var i = 0; i < msg.msg.length; i++) {
               if (i % 2 == 0)
                    arr.push("<tr bgcolor='#FFFFFF'>");
                else
                    arr.push("<tr bgcolor='#EEEDED'>");
                    arr.push("<td height='20' class='STYLE6'  style='text-align: center;'>");
                     if (depttype == "分行")
                        {
                           arr.push("<a  onclick=\"FKalert(" + msg.msg[i].id + "," + msg.msg[i].userid + "," + statrday + "," + endday + ",'" + msg.msg[i].user_name + "',2)\">" + msg.msg[i].user_name + "</a>");
                        }
                        else
                        {
                           arr.push("<a href=\"lp_Report_list.aspx?deptid=" + msg.msg[i].work_deptid + "&statrday=" + escape(statrday) + "&endday=" + escape(endday) + "\">" + msg.msg[i].work_deptname + "</a>");

                        }
                  
                   
                   arr.push("</td>");
                   arr.push("<td class=\"td\">");
                   arr.push("<a href=\"#\">" + msg.msg[i].actual_goal + "</a>");
                   arr.push("</td>");
                   arr.push("</tr>");
             }
               document.getElementById('divdatalist').innerHTML = arr.join('');
        }
      
      
    </script>
    </form>
</body>
</html>
